﻿using System;

namespace Array
{
    class Program
    {
        static void ArrayChange(int[] array)
        {
            for ( int i = 0; i < array.Length; i++)
            {
                array[i] = array[i]*array[i];
            }
        }
        static void Main(string[] args)
        {
            Console.WriteLine("请输入数组的长度：");
            int N = Convert.ToInt32(Console.ReadLine());
            int[] Array = new int[N];
            Console.WriteLine("请输入一个数字数组：");
            for ( int i = 0; i < N; i++)
            {
                Array[i] = Convert.ToInt32(Console.ReadLine());
            }
            Console.WriteLine();
            Console.WriteLine("原始数组为：");
            for (int i = 0; i < N; i++)
            {
                Console.Write(Array[i]+" ");
            }
            Console.WriteLine();
            ArrayChange(Array);
            Console.WriteLine("变更后数组为：");
            for (int i = 0; i < N; i++)
            {
                Console.Write(Array[i]+" ");
            }
            Console.WriteLine();
        }
    }
}
